/**
 * @file Bsp_ProportionalValves.h
 * @author 徐松亮 (5387603@qq.com)
 * @version 1.0
 * @date 2023-09-28
 *
 * @copyright Copyright (c) {2030}  沈阳迈思医疗科技有限公司
 *
 * @brief 驱动层-->比例阀控制程序(实质上为PWM输出控制)
 * @note (仅在h文件描述注释)
 * 	@verbatim
    1.适用芯片:
        STM      :  STM32F407xx STM32H743
    2.移植步骤:
        2.1     按项目设定.h文件相关参数
        2.2     在100ms周期函数调用函数
        2.3     在uctsk_Debug.h添加接口声明
    3.验证方法:
        在Debug环境加入调试指令，执行后循环打印数据，退出后关闭
    4.使用方法:
        见接口函数
    5.其他说明:
        STM32CubeMx初始化完成
    @endverbatim
 * @todo (仅在h文件描述待办事项)
 * @par 修改日志:
 * <table>
 * <tr><th>日期   <th>版本 <th>作者  <th>描述
 * <tr><td>2023-09-28 <td>1.0     <td>徐松亮     <td>创建初始版本
 * </table>
 */
/* 防止重复编译 (Define to prevent recursive inclusion)------------------------*/
#ifndef __BSP_PROPORTIONAL_VALVES_H
#define __BSP_PROPORTIONAL_VALVES_H
/* 通用头部文件 (General Includes)---------------------------------------------*/
#include <stdint.h>
#include "main.h"
#include "Bsp_PwmOut.h"
#include "Module_Count.h"
/* 公有类型定义 (Exported types)-----------------------------------------------*/
typedef enum
{
    BSP_PROPORTIONAL_VALVES_MODULE_C921TW20711 = 0,
    BSP_PROPORTIONAL_VALVES_MODULE_ASCO,
    BSP_PROPORTIONAL_VALVES_MODULE_PARKER,
} BSP_PROPORTIONAL_VALVES_MODULE;
typedef enum
{
    BSP_PROPORTIONAL_VALVES_MODULE_FREQ_C921TW20711 = 2000,
    BSP_PROPORTIONAL_VALVES_MODULE_FREQ_ASCO = 2000,
    BSP_PROPORTIONAL_VALVES_MODULE_FREQ_PARKER = 5000,
} BSP_PROPORTIONAL_VALVES_MODULE_FREQ;
/* 移植性宏定义 (Transplant define)--------------------------------------------*/
typedef struct
{
    void (*fnp_DebugOutStr)(int8_t *);
    BSP_PROPORTIONAL_VALVES_MODULE t_Module;
    BSP_PROPORTIONAL_VALVES_MODULE_FREQ t_Freq;
    uint16_t us_Pwm;
} BSP_PROPORTIONAL_VALVES_T_INPUT;
typedef struct
{
    void (*fnp_SetPwm)(void *);
} BSP_PROPORTIONAL_VALVES_T_OUTPUT;
typedef struct
{
    void (*fnp_Cycle_100ms)(void *);
} BSP_PROPORTIONAL_VALVES_T_TRANSPLANT;
typedef struct
{
    uint8_t uc_DebugTestEnable;
} BSP_PROPORTIONAL_VALVES_T_PRIVATE;
typedef struct
{
    BSP_PROPORTIONAL_VALVES_T_INPUT t_Input;
    BSP_PROPORTIONAL_VALVES_T_OUTPUT t_Output;
    BSP_PROPORTIONAL_VALVES_T_TRANSPLANT t_Transplant;
    BSP_PROPORTIONAL_VALVES_T_PRIVATE t_Private;
} BSP_PROPORTIONAL_VALVES_T_INTERFACE;
/* 应用性宏定义 (Application define)-------------------------------------------*/
/* 公有常量声明 (Exported constants)-------------------------------------------*/
/* 公有变量声明 (Exported variables)-------------------------------------------*/
/* 公有函数声明 (Exported functions)-------------------------------------------*/
void BspProportionalValves_Init(BSP_PROPORTIONAL_VALVES_T_INTERFACE *_tp_interface);
void BspProportionalValves_DebugTestOnOff(uint8_t OnOff, void *_vp_context);
void BspProportionalValves_TestOnOff(uint8_t OnOff, void *_vp_context);
#endif
/********************************END OF FILE***********************************/
